package com.hp.bon.sgw.bean;

public class ProcessBean {
	private long pid;
	private double cpu;
	private double mem;
	private String cmdline;

	public long getPid() {
		return pid;
	}

	public void setPid(long pid) {
		this.pid = pid;
	}

	public double getCpu() {
		return cpu;
	}

	public void setCpu(double cpu) {
		this.cpu = cpu;
	}

	public double getMem() {
		return mem;
	}

	public void setMem(double mem) {
		this.mem = mem;
	}

	public String getCmdline() {
		return cmdline;
	}

	public void setCmdline(String cmdline) {
		this.cmdline = cmdline;
	}

	public String getpName() {
		if (this.cmdline.contains("sgw_-i_hsql")) {
			return "sgw_-i_hsql";
		}
		if (this.cmdline.contains("sgw_-i_agent")) {
			return "sgw_-i_agent";
		}
		if (this.cmdline.contains("sgw_-i_ctrl")) {
			return "sgw_-i_ctrl";
		}
		if (this.cmdline.contains("sgw_-i_single")) {
			return "sgw_-i_single";
		}
		if (this.cmdline.contains("sgw_-i_core")) {
			return "sgw_-i_core";
		}
		if (this.cmdline.contains("sgw_-i_channel")) {
			return "sgw_-i_channel";
		}
		if (this.cmdline.contains("sgw_-i_ftpSv")) {
			return "sgw_-i_ftpSv";
		}
		if (this.cmdline.contains("sgw_-i_ftpCl")) {
			return "sgw_-i_ftpCl";
		}
		if (this.cmdline.contains("sgw_-i_ctpSv")) {
			return "sgw_-i_ctpSv";
		}
		if (this.cmdline.contains("sgw_-i_ctpCl")) {
			return "sgw_-i_ctpCl";
		}
		return "unknow";
	}

	public String toString() {
		return "[" + this.pid + "," + this.getpName() + "," + this.cpu + ","
				+ this.mem + "]";
	}

}
